using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.DirectX;

namespace AlumnoEjemplos.TP3D.Collider
{
    /*
     * Dos superficies estan en colision si existe una interseccion.
     */
    public abstract class CollisionSurface : Placeable
    {
        protected Placeable surrounded;
        protected bool _render = false;

        public bool MakeRender {
            set { this._render = value;  }
            get { return this._render; }
        }

        public abstract void Render();

        public CollisionSurface()
        {
        }

        public CollisionSurface(Placeable placeable)
        {
            this.Surrounded = placeable;
        }

        public virtual Placeable Surrounded
        {
            set
            {
                this.surrounded = value;
            }
            get
            {
                return this.surrounded;
            }
        }
        
        public Vector3 Position
        {
            get { return this.Surrounded.Position; }
            set { this.Surrounded.Position = value; }
        }

        public abstract bool IntersectWithBox(CollisionBox box);
        public abstract bool IntersectWithSphere(CollisionSphere sphere);

        public abstract Boolean Collides(CollisionSurface aSurface);

        #region Placeable Members


        public void MoveX(float ammount)
        {
            this.surrounded.MoveX(ammount);
        }

        public void doSomethingToMassive(Placeable p)
        {
            this.Surrounded.doSomethingToMassive(p);
        }
        #endregion
    }
}
